<?php 
$id = JRequest::getVar('id','','get','int');
$idcat = JRequest::getVar('catid','','get','int');

if(($id!==null && $id!=78) || $idcat!='')
    {
?>
      <div class="news_index">
      <div class="title_news_index">Danh mục sản phẩm</div>
      <?php 
      $db = JFactory::getDbo();
      $db->setQuery("SELECT * from #__categories where parent_id = 78 and published = 1 limit 0,10");
      $db->query();
      $result = $db->loadObjectList();      
      foreach($result as $obj){
          if(isset($id)&& !$idcat){
              if($obj->id==$id){
                  $class = 'active';
              }else{
                  $class = '';
              }
          }
          if(isset($id) && $idcat ){
              if($obj->id==$idcat){
                  $class = 'active';
              }else{
                  $class = '';
              }
          }
      ?>
      <a href="<?php echo JRoute::_(ContentHelperRoute::getCategoryRoute($obj->id));?>" class="news_index <?php echo $class;?>"><?php echo $obj->title;?></a> 
      <?php }?>     
      
      </div>
    <?php
    }
    ?>